<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <h:form id="form" prependId="false">
            <p:dataTable value="#{usersBean.users}" var="userS" id="tb77" selectionMode="single" selection="#{userCommentsBean.user}" rowKey="#{userS.id}">  
                <p:ajax event="rowSelect" listener="#{userCommentsBean.useronRowSelect}" update=":form:tb2" />
               
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="ID" />  
                    </f:facet>  

                    <h:outputText value="#{userS.id}" />
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Email" />  
                    </f:facet>  
                    <h:outputText value="#{userS.email}"/>
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Feedback" />  
                    </f:facet>  
                    
                </p:column>  
            </p:dataTable> 
            <p:dataTable value="#{userCommentsBean.commentses}" id="tb2" var="userCom" selectionMode="single" selection="#{userCommentsBean.select}" rowKey="#{userCom.id}"> 
                <p:ajax event="rowSelect" listener="#{userCommentsBean.onRowSelect}" update="tb2" />
               
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="User ID" />  
                    </f:facet>  
                    <h:outputText value="#{userCom.user.id}" />  
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Comments" />  
                    </f:facet>  
                    <h:outputText value="#{userCom.comment}"/>  
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Transervice ID" />  
                    </f:facet>  
                    <h:outputText value="#{userCom.tranService.id}"/>  
                </p:column> 

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Transervice Name" />  
                    </f:facet>  
                    <h:outputText value="#{userCom.tranService.name}"/>  
                </p:column>  
            </p:dataTable> 
        </h:form>
    </h:body>
</html>

